<template>
    <div class="page-box w">
        共计 {{ total }}
        <el-pagination
            @current-change="handleCurrentChange"
            :current-page="searchType.currentPage"
            layout="total,  prev, pager, next, jumper"
            :total="total"
            :page-size="searchType.limit"
            background
        >
        </el-pagination>
    </div>
</template>

<script>
import { createNamespacedHelpers } from "vuex";
const { mapState, mapMutations, mapActions } = createNamespacedHelpers(
    "searchDetails"
);
export default {
    data() {
        return {
            loading: false,
            musicCurrentPage: 1,
        };
    },
    computed: {
        ...mapState(["total", "searchType"]),
    },
    methods: {
        ...mapMutations(["changeCurrentPage", "changePrevY"]),
        ...mapActions(["search"]),
        handleCurrentChange(val) {
            this.changePrevY(0);
            console.log(`当前页: ${val}`);
            this.changeCurrentPage(val);
            this.search(this.$route.params._keywords);
            console.log(val);
        },
    },
};
</script>

<style>
</style>